﻿using Application.Permissions.Models;

namespace Application.Permissions.Interfaces
{
    public interface IPermissionService
    {
        /// <summary>
        /// 获取权限
        /// </summary>
        /// <param name="sign"></param>
        /// <returns></returns>
        PermissionDto GetBySign(string sign);

        /// <summary>
        /// 验证是否存在
        /// </summary>
        /// <param name="sign"></param>
        /// <returns></returns>
        bool IsValidSign(string sign);

        /// <summary>
        /// 获取全部权限
        /// </summary>
        /// <returns></returns>
        IReadOnlyList<PermissionGroup> GetAll();

        /// <summary>
        /// 从权限文件夹中读取权限列表
        /// </summary>
        /// <returns></returns>
        Task ReloadAsync();

        /// <summary>
        /// 同步加载
        /// </summary>
        void Reload();
    }
}
